package com.unipay.vo.user;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.unipay.common.utils.BaseSearch;
import com.unipay.model.user.UserInfo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

@Data
@ApiModel(description="会员搜索对象")
public class UserInfoQueryVo extends BaseSearch<UserInfo> {

    @ApiModelProperty(value = "关键字")
    private String keyword;

    @ApiModelProperty(value = "状态")
    private Integer status;

    @ApiModelProperty(value = "认证状态")
    private Integer authStatus;

    @ApiModelProperty(value = "创建时间")
    private String createTimeBegin;

    @ApiModelProperty(value = "创建时间")
    private String createTimeEnd;

    public QueryWrapper<UserInfo> buildQueryWrapper(){
        QueryWrapper<UserInfo> queryWrapper = new QueryWrapper<>();
        notNullLike("name", keyword, queryWrapper);
        notNullEq("status", status, queryWrapper);
        notNullEq("auth_status", authStatus, queryWrapper);
        notNullge("create_time", createTimeBegin, queryWrapper);
        notNullle("create_time", createTimeEnd, queryWrapper);
        return queryWrapper;
    }
}
